from starlette.endpoints import HTTPEndpoint
from database import Session, engine
import datetime
from dao import DaoBureauMonRepSum


class BureauMonRepSum(HTTPEndpoint):

    async def get(self, request):
        session = Session()
        try:
           bureauid = request.query_params["bureauid"]
           monthnum = request.query_params["monthnum"]
           return  DaoBureauMonRepSum.get_monrep_info(session, bureauid, monthnum)
        finally:
            session.close()